governance: principle-as-plugin — array emptied, governance is pure aggregator#8
Merged
Merged
Conversation
GOVERNANCE_PRINCIPLES was a 16-entry hardcoded array. Move each entry to
a plugin (granularity option 2: a guard that already ENFORCES a principle
becomes the single SSOT by also CONTRIBUTING its text; non-enforced
principles → new principle-<id> plugins later). governance becomes a
pure aggregator + profile resolver.
Mechanism: governance_collect_principles fires host_fire_hook(
"governance_principles", {list:[]}) (the generic wrapper added in phase
1.5) — contributing plugins append #{id,order,default_on,text} via the
event_bus transform fold; governance merges with the not-yet-migrated
in-code array (id-dedup, plugin wins), sorts by order (legacy entry →
1-based index implicit order), then applies the existing profile /
WILSON_GOVERNANCE_OFF / default_on resolution (unchanged, still
governance-owned). Fake-host (void bus) guard skips the hook so
selftests stay on the array path.
This slice (vertical, 1 principle):
- governance/main.hexa: collect / order_sort / has_id / is_on_rec;
active_principles, active_principle_ids, principles(), default_on
rewritten over the collected set; readme-format removed from the array.
- guard-readme-format/main.hexa: subscribes governance_principles@transform,
grf_on fold branch, grf_principle_text() (text moved verbatim). This
guard is now the single SSOT for readme-format (enforce + text).
Verified: wilson build (default) OK; wilson test 23/23; governance
selftest ok (array path + profile resolution unchanged); unit-checked
the new contribution path (grf_on on governance_principles/transform
returns {action:replace,value:{list:[readme-format rec]}} with
id/order=16/default_on/text intact). End-to-end session render is
outside `wilson test` (interactive+LLM); correctness by construction
(same fire_hook/_is_replace contract proven elsewhere this session).
Reference pattern for the remaining 15 (4 guard-merges + ~11 new
principle-<id> plugins) — fan-out tracked in the session log.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…overnance is pure aggregator
Completes the migration started by the readme-format slice. All 16
GOVERNANCE_PRINCIPLES entries are now plugin-owned; the in-code array is
empty; governance only aggregates (governance_collect_principles fires
the governance_principles transform fold) + resolves profiles.
- guard-merge (5): the guard that ENFORCES a principle also CONTRIBUTES
its text (single SSOT) — readme-format→guard-readme-format (slice),
hexa-verifier-cli→guard-hexa-verify, domain-meta-domain→guard-domain-lint,
tape-runtime-trace→guard-tape-append-only, project-governance→project-rules.
- new principle-<id> plugins (11): the non-enforced text principles
(verification-via-hexa-cli-only, atlas-knowledge, atlas-strict-lint,
hexa-cli-surface, ai-native, pool-resource-routing, hexa-first,
andrej-karpathy-skills, lattice-as-tool, step-by-step-decision-gate[off],
closure-depth-accumulation[off]). Generated (verbatim text, no
transcription drift); uniform governance_principles@transform contributor.
- registration: core/dispatch_table.hexa (use + dispatch arm +
dispatch_static_ids + bundled_manifests, all 11), plugins/_bundle
(11 members), core/loader.hexa (11 family/category). default-bundle.
- governance/main.hexa: GOVERNANCE_PRINCIPLES = []; collect/order_sort/
is_on_rec drive everything via the fold (profile resolution unchanged).
- docs: governance main.hexa header + AGENTS.tape g1 (a deny:write rule
that wrongly mandated editing the now-gone array) / ssot / l1 /
x_principle_plugins / id001 + SPEC.md banner corrected to "each
principle's SSOT = its plugin; governance aggregates". Per-principle
SPEC §Principles rewrite flagged as doc-debt.
Verified: wilson build (default) OK; wilson test 23/23; plugin info
principle-ai-native registered; contribution unit-checked for the 4
hand-merged guards (varied structure) + generated plugins (correct
{id,order,default_on,text}); governance selftest honestly rewritten for
the aggregator architecture (fake-host void-bus degrades to empty by
design; profile-resolution steps 1-5 are fold-independent and covered)
→ ok. End-to-end fold proven by the readme-format slice + by
construction (same fire_hook/_is_replace path).
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
GOVERNANCE_PRINCIPLESwas a 16-entry hardcoded array inplugins/governance/main.hexa. This moves every principle into a
plugin and reduces governance to a pure aggregator + profile resolver.
2 commits (vertical slice + full fan-out):
governance_collect_principlesfires agovernance_principlestransform fold (via the phase-1.5host_fire_hook); contributing plugins append#{id,order,default_on, text}; governance merges, order-sorts, profile-filters. readme-formatmigrated as the reference pattern.
principle also CONTRIBUTES its text = single SSOT: guard-readme-format,
guard-hexa-verify, guard-domain-lint, guard-tape-append-only,
project-rules) + 11 new
principle-<id>plugins for the non-enforcedtext principles.
GOVERNANCE_PRINCIPLES = [].Registration (default-bundle)
core/dispatch_table.hexa (use + dispatch arm + dispatch_static_ids +
bundled_manifests ×11), plugins/_bundle (×11 members), core/loader.hexa
(×11 family/category). New plugins are default-bundle (the agent's
operating constitution); profile / WILSON_GOVERNANCE_OFF still gate the
active subset.
Test
wilson build(default) OK;wilson test23/23;plugin info principle-ai-nativeregistered; contribution unit-checked for the 4hand-merged guards (varied structure) + generated plugins; governance
selftest honestly rewritten for the aggregator architecture (fake-host
void-bus degrades to empty by design — profile-resolution steps 1-5 are
fold-independent and covered; default_on/active-subset/block need the
real fold → covered by wilson test + contribution checks + the slice's
end-to-end proof). Correctness by construction (same fire_hook /
event_bus
_is_replacepath proven elsewhere this session).Notes
_bundle / loader taxonomy) every plugin needs — not policy coupling.
deny:writerule that mandated editingthe now-gone array) + SPEC.md banner corrected. Per-principle SPEC
§Principles rewrite flagged as doc-debt (non-blocking).
🤖 Generated with Claude Code